<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/


Route::prefix('v1')->group(function() {

    Route::post('/user/login', 'API\UserController@login');
    Route::post('/user/register', 'API\UserController@register');
    Route::get('/game/query', 'API\GameController@query');
    Route::get('/game/rank', 'API\GameController@rank');
    Route::get('/game/statistics', 'API\GameController@statistics');
    Route::post('/game/error', 'API\GameController@error');
    Route::get('/comment/query', 'API\CommentController@query');
    Route::get('/creative/query', 'API\CreativeController@query');

    Route::get('/game/{id}/show', 'API\GameController@show');

    Route::middleware('auth:api')->group(function(){
        Route::get('/user/detail', 'API\UserController@detail');
        Route::post('/feedback', 'API\UserController@feedback');
        Route::post('/game/save', 'API\GameController@save');
        Route::get('/game/records', 'API\GameController@records');
        Route::post('/comment/send', 'API\CommentController@send');
    });

});

